Skip to content

feat: update Customers API#59

Open
akhil-vamshi-konam wants to merge 5 commits into
mainfrom
feat-support-customer-api
Open

feat: update Customers API#59
akhil-vamshi-konam wants to merge 5 commits into
mainfrom
feat-support-customer-api

Conversation

@akhil-vamshi-konam

@akhil-vamshi-konam akhil-vamshi-konam commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

Adds support for the latest Customers API, including:

  • Customer property values APIs
  • Customer work item link/unlink APIs
  • Enhanced customer requests support
  • External ID-based customer deletion
  • Support for query parameters in POST/DELETE requests
  • New customer models and serialization improvements
  • Expanded unit test coverage

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

N/A

Test Scenarios

  • Added unit tests for the newly introduced Customers APIs and models.
  • Verified create, retrieve, update, delete, property values, work item linking, and request APIs.

References

N/A

Summary by CodeRabbit

  • New Features

    • Added customer property value management, including listing, setting, retrieving, and updating values.
    • Added customer work item linking, unlinking, searching, and filtering.
    • Added customer deletion by external identifier.
    • Added paginated customer request listings and support for linking work items when creating requests.
    • Expanded customer properties with configurable options and external identifiers.
  • Bug Fixes

    • Improved support for query parameters in customer-related requests.
  • Chores

    • Updated package version to 0.2.20.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@akhil-vamshi-konam, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6823a6d7-0c51-41ea-b5eb-24db4f6dff3d

📥 Commits

Reviewing files that changed from the base of the PR and between e43464f and 0f38ee6.

📒 Files selected for processing (5)
  • plane/api/customers/base.py
  • plane/api/customers/property_values.py
  • plane/api/customers/work_items.py
  • plane/models/customers.py
  • tests/unit/test_customers.py
📝 Walkthrough

Walkthrough

Customer APIs now support property values, work-item associations, external-ID deletion, richer customer/property models, and paginated customer requests. HTTP POST and DELETE helpers accept query parameters, while unit tests cover the expanded customer workflows.

Changes

Customer API expansion

Layer / File(s) Summary
Customer data contracts
plane/models/customers.py
Customer external identifiers, property options, property values, work-item linking models, create-request payloads, and paginated request responses are added or extended.
Customer resource operations
plane/api/base_resource.py, plane/api/customers/base.py, plane/api/customers/property_values.py, plane/api/customers/work_items.py
POST and DELETE helpers forward query parameters; customer sub-resources expose property-value and work-item operations, and customers can be deleted by external identifier.
Request API and behavioral validation
plane/api/customers/requests.py, tests/unit/test_customers.py, pyproject.toml
Customer requests use paginated responses and accept create-specific payloads; expanded tests cover customer, property, request, and work-item behavior, and the package version becomes 0.2.20.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Customers
  participant CustomerWorkItems
  participant PlaneAPI
  Client->>Customers: access customer resources
  Customers->>CustomerWorkItems: link or unlink work items
  CustomerWorkItems->>PlaneAPI: send query parameters and payload
  PlaneAPI-->>CustomerWorkItems: return linked or removed work-item data
  CustomerWorkItems-->>Client: return validated response
Loading

Possibly related PRs

Suggested reviewers: dheeru0198

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is broadly aligned with the PR, which updates the Customers API and related models, requests, and tests.
Docstring Coverage ✅ Passed Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-support-customer-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@akhil-vamshi-konam akhil-vamshi-konam changed the title feat: add Customers API support feat: update Customers API Jul 16, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
plane/api/customers/requests.py (2)

17-35: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Version the paginated request-list return type as a breaking change.

  • plane/api/customers/requests.py#L17-L35: preserve the previous list contract or explicitly introduce the pagination model as a breaking API change.
  • pyproject.toml#L7-L7: use a minor version such as 0.3.0 if compatibility is not retained.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plane/api/customers/requests.py` around lines 17 - 35, The
customers.requests.list method changes its return contract to
PaginatedCustomerRequestResponse; either preserve the previous list-compatible
contract or explicitly release this as a breaking change. If retaining the new
pagination model, update pyproject.toml to the next minor version (such as
0.3.0); otherwise adjust list to return the prior type and behavior.

48-70: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Accept only CreateCustomerRequest here. CustomerRequest is a response model with extra="allow", so passing it through model_dump(exclude_none=True) can send read-only extras back to the create endpoint. Normalize legacy callers through CreateCustomerRequest before posting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plane/api/customers/requests.py` around lines 48 - 70, Update the create
method in the customer requests client to accept only CreateCustomerRequest and
normalize any legacy CustomerRequest input into that model before calling _post.
Ensure the payload comes exclusively from the normalized
CreateCustomerRequest.model_dump(exclude_none=True), preventing response-only
extra fields from being submitted.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plane/api/customers/base.py`:
- Around line 84-97: Rename the affected customer resource methods to use
standard CRUD verbs: change delete_by_external_id to delete in
plane/api/customers/base.py lines 84-97; rename the bulk set method to create in
plane/api/customers/property_values.py lines 42-61; rename the work-item linking
method to create in plane/api/customers/work_items.py lines 54-78; and rename
the unlinking method to delete in plane/api/customers/work_items.py lines
80-102. Preserve each method’s existing behavior and parameters.

In `@plane/api/customers/property_values.py`:
- Around line 27-40: Add response DTOs for customer property values and update
both list() and retrieve() to validate _get() results through the appropriate
DTO model_validate() calls before returning them. Preserve the documented empty
mapping behavior where applicable, while ensuring malformed responses are
rejected before callers can access unexpected shapes or invoke .get().

In `@tests/unit/test_customers.py`:
- Around line 53-65: Update test_list_customers_with_params and
test_list_customers_paginates to create at least two customers before listing,
assert the expected page size and pagination state unconditionally, and clean up
the created customers afterward. Reuse the existing customer creation and
deletion helpers/fixtures in the test suite.
- Around line 143-146: Update the cleanup blocks in the customer tests,
including the repeated cleanup handlers, to suppress only the expected
not-found/404 exception from delete operations. Re-raise all other exceptions so
failures deleting customers, properties, requests, or work items are visible
instead of silently ignored.

---

Outside diff comments:
In `@plane/api/customers/requests.py`:
- Around line 17-35: The customers.requests.list method changes its return
contract to PaginatedCustomerRequestResponse; either preserve the previous
list-compatible contract or explicitly release this as a breaking change. If
retaining the new pagination model, update pyproject.toml to the next minor
version (such as 0.3.0); otherwise adjust list to return the prior type and
behavior.
- Around line 48-70: Update the create method in the customer requests client to
accept only CreateCustomerRequest and normalize any legacy CustomerRequest input
into that model before calling _post. Ensure the payload comes exclusively from
the normalized CreateCustomerRequest.model_dump(exclude_none=True), preventing
response-only extra fields from being submitted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f537a59a-8a9f-4a59-abac-bf1388641eaa

📥 Commits

Reviewing files that changed from the base of the PR and between 3795bed and e43464f.

📒 Files selected for processing (8)
  • plane/api/base_resource.py
  • plane/api/customers/base.py
  • plane/api/customers/property_values.py
  • plane/api/customers/requests.py
  • plane/api/customers/work_items.py
  • plane/models/customers.py
  • pyproject.toml
  • tests/unit/test_customers.py

Comment thread plane/api/customers/base.py Outdated
Comment thread plane/api/customers/property_values.py Outdated
Comment thread tests/unit/test_customers.py
Comment thread tests/unit/test_customers.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant